const express = require('express');
const app = express();
const path = require('path')
app.listen(3000, () => { console.log('服务器已开启') });

// 使用模块化的代码
const myquery=require('./模块化');

app.get('/',(req,res)=>{
    res.sendFile(path.join(__dirname,'前端.html'))
})
app.get('/index',async (req,res)=>{
    let sql=`select * from trade`;
    let [err,result]=await myquery(sql);
    res.send(result);
})